$(function(){ 
	
	 initServiceInfor();
	 function initServiceInfor(){
	 	var $id = utilModule.getQueryString("id");
	 	var $questionId = utilModule.getQueryString("questionid");
	 	var number = utilModule.getQueryString("typeOrder");
	 	if($id==undefined){
	 		var $id = $questionId;
	 	}
	 
	 	var params = {
	 		id:$id,
	 		typeOrder: number
	 	}
	 
	 	userCenterModule.myServiceInfor(params,function(callBack){
	 		console.log(callBack);
	 			var $sex=callBack.sex;
		 		if(callBack.sex==1){
		 			$sex = "男";
		 		}else{
		 			$sex = "女"
		 		}
		 		var shtml;
	 			if(number==1){
	 				shtml="<div class='consultation-detail'><p class='font4'>患者详情：<span class='font3'>"+callBack.name+"　"+$sex+" 　"+callBack.age+"岁</span></p>"
	 				+"<p class='font4 consultation-content'>问题描述：</p><aside class='font3'>"+callBack.questionbody+"</aside><div class='consultation-imgs'></div></div>";
	 				
	 			}else if(number==2){
	 				shtml="<div class='consultation-detail'><p class='font4'>患者详情：<span class='font3'>"+callBack.name+"　"+$sex+" 　"+callBack.age+"岁</span></p>"
	 				+"<p class='font4 consultation-content'>问题描述：</p><aside class='font3'>"+callBack.questionbody+"</aside><div class='consultation-imgs'></div></div>"+"<div class='pay-infor'><p class='pay-way'>支付方式：<span>余额支付</span></p>"+
	 				"<p class='pay-balance'>支付金额：<span>¥"+callBack.payAmount+"元</span></p>"+"<p>支付时间：<span>"+callBack.createtime+"</span></p></div>"
	 				
	 			}else if(number==3){
	 				shtml="<div class='consultation-detail'><p class='font4'>患者详情：<span class='font3'>"+callBack.name+"　"+$sex+" 　"+callBack.age+"岁</span></p>"+"<p>预约时间：<span>"+callBack.servicetime+"</span></p>"
	 				+"<p>接听电话：<span>"+callBack.answerPhone+"</span></p>"
	 				+"<p class='font4 consultation-content'>问题描述：</p><aside class='font3'>"+callBack.questionbody+"</aside><div class='consultation-imgs'></div></div>"+"<div class='pay-infor'><p class='pay-way'>支付方式：<span>微信支付</span></p>"
	 				+"<p class='pay-balance'>支付金额：<span>¥"+callBack.price+"元</span></p>"+"<p>支付时间：<span>"+callBack.createTime+"</span></p></div>"
	 				
	 			}else if(number==4){
	 				var $sex = callBack.patient_sex;
	 				if(callBack.patient_sex==1){
	 					$sex = "男";
	 				}else{
	 					$sex = "女";
	 				}
	 				shtml="<div class='consultation-detail'><p class='font4'>患者详情：<span class='font3'>"+callBack.patient_name+"　"+$sex+" 　"+callBack.patient_age+"岁</span></p>"+"<p>预约时间：<span>十分钟内回拨</span></p>"
	 				+"<p>接听电话：<span>"+callBack.answer_mobile+"</span></p>"
	 				+"<p class='font4 consultation-content'>问题描述：</p><aside class='font3'>"+callBack.question_body+"</aside><div class='consultation-imgs'></div></div>"+"<div class='pay-infor'><p class='pay-way'>支付方式：<span>微信支付</span></p>"
	 				+"<p class='pay-balance'>支付金额：<span>¥"+callBack.order_amount+"元</span></p>"+"<p>支付时间：<span>"+callBack.pay_time+"</span></p></div>"
	 			
	 			}else if(number==5){
	 				var $isreflection = callBack.isreflection;
	 				if(callBack.isreflection==1){
	 					$isreflection = "有"
	 				}else{
	 					$isreflection = "无"
	 				}
	 				var $isallergy = callBack.isallergy;
	 				if(callBack.isallergy==1){
	 					$isallergy = "有"
	 				}else{
	 					$isallergy = "无"
	 				}
	 				var $istake= callBack.istake;
	 				if(callBack.istake==1){
	 					$istake = "有"
	 				}else{
	 					$istake = "无"
	 				}
	 				shtml="<div class='consultation-detail'><p class='font4'>患者详情：<span class='font3'>"+callBack.name+"　"+$sex+" 　"+callBack.age+"岁</span></p>"
	 				+"<p>拟配药品:<span>"+callBack.drugsname+"</span></p>"+"<p>所患疾病:<span>"+callBack.disease+"</span></p>"+"<p>是否服用过此药:<span>"+$istake+"</span></p>"
	 				+"<p>服用后不良反应:<span>"+$isreflection+"</span></p>"
	 				+"<p>是否有过敏史:<span>"+$isallergy+"</span></p>"
	 				+"<p class='font4 consultation-content'>问题描述：</p><aside class='font3'>"+callBack.explain+"</aside><div class='consultation-imgs'></div></div>";
	 			}
	 			$("#consultation_detail").append(shtml);
	 			var  html ="";
	 			if(callBack.questionfiles){
	 				var data = callBack.questionfiles.split(",");
	 				$(".consultation-imgs").show();
	 				for(var i = 0; i<data.length;i++){
	 					if(data[i]!=""){
	 						html+= "<img src="+data[i]+" >";
	 					}
	 					console.log(data[i]);
	 				}
	 				$(".consultation-imgs").append(html); 
	 					
	 			}
	 			
	 	})
	 }
	 
	
	$(".html-loding").hide();


});